<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/jquery-3.2.1.min.js"></script>
    <script src="lib/common.js"></script>
    <style> 
        .divcss5{ word-wrap:break-word; overflow:hidden;} 
    </style>
    <script>
        $(function () {
            $("#b_Info").click(function () {
                $.ajax({
                    type: "POST",
                    url: config.contextUrl + "login",
                    data: $("#loginForm").serialize(),
                    success: function (msg) {
                        if (msg.success) {
                            //alert("Data Saved: " + msg.data);
                            console.log(msg.data);
                            config.token = msg.data;
                            $("#tokenDiv").html(msg.data);
                        }
                    }
                });
            });
            $("#a_Info").click(function () {
                $.ajax({
                    type: "POST",
                    url: config.contextUrl + "sysUser/getSysUser",
                    headers: {
                        "token": config.token
                    },
                    success: function (msg) {
                        if (msg.success) {
                            //alert("Data Saved: " + msg.data);
                            console.log(msg.data);
                            $("#tokenDiv").html(JSON.stringify(msg.data));
                        }
                    }
                });
            });
        })
    </script>
</head>

<body>
    <form id="loginForm">
        <table>
            <tr>
                <td>username:</td>
                <td><input id="username" name="username" type="text" value="admin"/></td>
            </tr>
            <tr>
                <td>password:</td>
                <td><input id="password" name="password" type="password" value="111111"/></td>
            </tr>
        </table>
    </form>
    <input id="b_Info" type="button" value="Info" />
    <input id="a_Info" type="button" value="Add" />
    <div id="tokenDiv" class="divcss5"></div>
</body>

</html>